package dao;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CodevalueId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CodevalueId implements java.io.Serializable {

	// Fields

	private Short code;
	private String value;

	// Constructors

	/** default constructor */
	public CodevalueId() {
	}

	/** full constructor */
	public CodevalueId(Short code, String value) {
		this.code = code;
		this.value = value;
	}

	// Property accessors

	@Column(name = "code")
	public Short getCode() {
		return this.code;
	}

	public void setCode(Short code) {
		this.code = code;
	}

	@Column(name = "value")
	public String getValue() {
		return this.value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CodevalueId))
			return false;
		CodevalueId castOther = (CodevalueId) other;

		return ((this.getCode() == castOther.getCode()) || (this.getCode() != null
				&& castOther.getCode() != null && this.getCode().equals(
				castOther.getCode())))
				&& ((this.getValue() == castOther.getValue()) || (this
						.getValue() != null && castOther.getValue() != null && this
						.getValue().equals(castOther.getValue())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCode() == null ? 0 : this.getCode().hashCode());
		result = 37 * result
				+ (getValue() == null ? 0 : this.getValue().hashCode());
		return result;
	}

}